package com.leyou.gateway.web;

import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description:
 * @author: YHL
 * @time: 2021/2/13 16:49
 */
@RestController
public class FallbackController {
 @GetMapping("hystrix/fallback")
 public ResponseEntity<String>  handleFallback(){
//     返回的是响应对象的封装 封装两部分内容 ，分别是状态码和信息
     return ResponseEntity.status(HttpStatus.GATEWAY_TIMEOUT).body("服务器请求超时") ;
    }
}
